Skip to content

C standard update and CI fixes#454

Merged
ebiggers merged 5 commits into
masterfrom
c11
May 16, 2026
Merged

C standard update and CI fixes#454
ebiggers merged 5 commits into
masterfrom
c11

Conversation

@ebiggers
Copy link
Copy Markdown
Owner

@ebiggers ebiggers commented May 16, 2026

  • Upgrade CMAKE_C_STANDARD to C11
  • common_defs.h: remove fallback definition of 'restrict'
  • deflate_decompress.c: add restrict qualifiers to dispatch_decomp()
  • ci.yml: Update vcpkg zlib path
  • lib/x86: Bring back evex512 and no-evex512 for clang 18

clang has started generating a -Wc11-extensions warning when compiling
programs/prog_util.c and programs/tgetopt.c, because glibc's string.h
started using _Generic.  Let's go ahead and just upgrade the targeted C
standard from C99 to C11.  Even MSVC supports it now (though this does
bump the requirement from Visual Studio 2015 to 2019 v16.8).
@ebiggers ebiggers force-pushed the c11 branch 4 times, most recently from ac0266b to 0b6e8be Compare May 16, 2026 19:28
ebiggers added 2 commits May 16, 2026 12:31
Now that C11 is targeted, 'restrict' is now always supported.
MSVC doesn't drop the restrict qualifier from arguments when assessing
function prototype compatibility, causing warning C4113 on the line
'decompress_func_t decompress_impl = dispatch_decomp;'.  Work around
this by adding restrict qualifiers to dispatch_decomp().

Note that MSVC's behavior seems to violate the following from C11:

    In the determination of type compatibility and of a composite type,
    each parameter declared with function or array type is taken as
    having the adjusted type and each parameter declared with qualified
    type is taken as having the unqualified version of its declared
    type.
The windows-visualstudio-build-and-test job stopped being able to find
zlib because the filename changed.  Update the filename.
Ubuntu shipped a clang version that broke backwards compatibility by
requiring evex512 and no-evex512 flags.  It was rolled back in the next
version, but for now, this workaround is still needed.

Fixes the "Build and test (x86_64, ubuntu-24.04, clang)" job.
@ebiggers ebiggers changed the title Upgrade CMAKE_C_STANDARD to C11 C standard update and CI fixes May 16, 2026
@ebiggers ebiggers merged commit e886d45 into master May 16, 2026
47 checks passed
@ebiggers ebiggers deleted the c11 branch May 16, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant